﻿$(function () {
    window.resizeFlexiGrid = new ResizeFlexiGrid(".flexigrid", "#SettingList", ".flexigrid .bDiv", ["#TitleTR", ".flexigrid .hDiv"], 4, 4);
    $("#SettingList").flexigrid({
        colModel: [
                { display: '目录名', name: 'ListForder', width: 150, sortable: false, align: 'left' },
                { display: '文件名', name: 'ViewName', width: 150, sortable: false, align: 'left' },
                { display: '完整路径', name: 'Path', width: 550, sortable: false, align: 'left' },
                { display: '网络路径', name: 'URL', width: 0, sortable: false, align: 'left', hide: true }
                ],

        width: "auto",
        height: "auto",
        resizable: false,
        showToggleBtn: false,
        striped: true,

        nonSelect: true,
        singleSelect: true,

        procmsg: '正在处理数据，请稍候……',
        nomsg: '没有符合条件的记录存在。',
        errormsg: '处理数据时出错，请与系统管理员联系！',

        onError: FlexiGrid_Error,
        onRowClick: FlexiGrid_RowClick
    });
    $("#SettingList .hDiv").bind("selectstart", function () { return false; });
    window.resizeFlexiGrid.MinHeight();
    window.resizeFlexiGrid.Width();
    window.resizeFlexiGrid.Height();
    window.resizeFlexiGrid.Resize("resizeFlexiGrid");
});

function FlexiGrid_Error(XMLHttpRequest, textStatus, errorThrown) {
    infoDialog.OpenDialog("处理数据时出错，请与系统管理员联系！", "Error");
}

function FlexiGrid_RowClick(Obj, g, p) {
    window.location.href = Obj.cells[3].getElementsByTagName("div")[0].getElementsByTagName("a")[0].href;
}